﻿using System;
using BoldBrick.Web.Parameters;

namespace BoldBrick.SharePoint.CommonControls.DataObjects.Query
{
	public class ListItemPageQueryParameters
	{
		[ParameterName("listid")]
		public Guid? ListID { get; set; }

		[ParameterName("itemid")]
		public int ItemID { get; set; }

		[ParameterName("items")]
		public int[] Items { get; set; }

		/// <summary>
		/// Creates <see cref="ListItemPageQueryParameters"/> instance
		/// </summary>
		/// <returns>Returns <see cref="ListItemPageQueryParameters"/> instance with values from HttpContent.Current</returns>
		public static ListItemPageQueryParameters GetParametersFromContext()
		{
			RequestQueryParametersProvider target = new RequestQueryParametersProvider();
			ListItemPageQueryParameters queryParameters = target.LoadParameters<ListItemPageQueryParameters>();
			return queryParameters;
		}
	}
}
